


String.prototype.myIncludes2 = function (str) {
    // 121312312 123
    const origin = this.split('')
    const find = str.split('')
    for (let i = 0 ; i < origin.length; i ++) {
        let ni = i
        for (let j = 0; j < find.length; j ++) {
            let nj = j
            if (origin[ni] !== str[nj]) break
            else {
                ni ++
            }
            if (j === find.length - 1) return true
        }
    }
    return false
}

console.log("121312312".myIncludes2("1234"));
